package com.dpp.mapper;

import com.dpp.entity.AddressBook;
import com.dpp.entity.Coupon;
import com.dpp.entity.CouponBook;
import com.dpp.entity.Orders;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * ClassName:    TestMapper
 * Package:  TestMapper
 * Description:
 *
 * @Author: Toykie
 * Create:   2023/10/22 -  11:02
 * @Version:
 */

@Mapper
public interface TestMapper {
    @Select("SELECT count(id) FROM orders")
    int selectByOpenidAmount();

    @Select("SELECT * FROM address_book")
    List<AddressBook> selectAddressBook();


    @Select("SELECT * FROM orders")
    List<Orders> selectAllOrders();

    @Select("SELECT count(id) FROM orders where order_status=#{status}")
    int selectByOrderSStatus(int status);

    @Select("SELECT * from coupon_book where openid=#{openid}")
    List<CouponBook> selectCouponBookByOpenid(String openid);




}
